var mongoose = require('mongoose');

const get = async function (parameter) {
    return await mongoose.model("users").find(parameter)
};

const update = async function (_id, parameter) {
    return await mongoose.model("users").update({ _id }, parameter)
}

const del = async function (_id) {
    return await mongoose.model("users").deleteOne(_id)
}
const add = async function (parameter) {
    return await mongoose.model("users").create(parameter)
}
const search = async function (parameter) {
    return await mongoose.model("users").find(parameter)
}
module.exports = { get,update,del,add,search}